<template>
	<view v-if="list" class="container bacFFF">
		<view class="wid90 mar dis disAl" style="padding: 38rpx 0;">
			<view class="wid20">
				<image :src="url + list.avatar" style="width: 90rpx;height: 90rpx;"></image>
			</view>
			<view class="wid80">
				<view class="wid100 liH40 foSi40 fowebl">{{ list.name }}</view>
				
				<view class="wid100 liH40 foSi28 fowebl">{{ list.email }}</view>
				<view class="wid100 liH40 foSi28 fowebl">{{ list.tel }}</view>
				
				<!-- <view class="dis disAl mar-top10">
					<image src="../../static/imgs/icon/renzheng.png" 
						style="width: 33rpx;height: 33rpx;"></image>
					<view class="mar-left10 foSi25" style="color: #3978F9;">已认证</view>
				</view> -->
			</view>
		</view>
		<!-- <view class="wid90 mar borRad20 " style="background-color: #E1ECFB;">
			<view class="wid90 mar hei80 dis disAl foSi28">
				<view class="mar-right30" style="width: 40rpx;height: 40rpx;">
					<image src="../../static/imgs/icon/fuli.png" 
						class="wh100"></image>
				</view>
				<view style="color: #337EE6;">{{ list.email }}</view>
			</view>
		</view> -->
		<view v-if="list.qual_img != ''" v-for="(item,index) in list.qual_img.split(',')" :key="index" class="mar-top30 wid90 mar" style="height: 475rpx;">
			<image :src="url+item" class="wh100"></image>
		</view>
		<view class="wid90 mar mar-top40">
			<view class="foSi40 liH40 fowebl mar-bott40">公司介绍</view>
			<view class="wid100">
				<rich-text class="rich" :nodes="list.brief_content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		Company
	} from './company-model.js';
	var company = new Company(); //实例化 首页 对象
	import { Config } from '../../utils/config.js';
	export default {
		data() {
			return {
				url: Config.restUrl,
				list: null
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(e) {
			this.getList()
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady: function() {},
		methods: {
			getList() {
				var that = this
				let params = {}
				company.getCompanyLists((data) => {
					console.log(data)
					if (data.code === 1) {
						that.list = data.data
						that.list.brief_content = that.list.brief_content.replace(/<img/gi, "<img class='richImg'");
					} else {
						uni.showToast({
							title: data.msg,
							icon: 'none',
							duration: 2000
						})
					}
				}, params)
			},
		}
	};
</script>
<style>
	.container {
		min-height: 100%;
	}
	.rich{
		word-break: break-all;
		white-space: pre-warp;
	}
	.richImg {
	    width: 100% !important;
	    height: auto !important;
	}
</style>